Calculates a root of the expression or a function in the closed interval [a; b].